package com.deryun.tyl.bean.mapper;

import java.util.List;

import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import com.deryun.tyl.bean.IndexImage;

public interface IndexImageMapper {

	@Update({
		"UPDATE index_image SET "
		+ "pic_name = #{picName,jdbcType=VARCHAR},"
		+ "title = #{title,jdbcType=VARCHAR},"
		+ "plate = #{plate,jdbcType=VARCHAR},"
		+ "address = #{address,jdbcType=VARCHAR} "
		+ "WHERE "
		+ "plate = #{plate,jdbcType=VARCHAR} and pic_position = #{picPosition,jdbcType=VARCHAR}"
	})
	int updateIndex(IndexImage image);
	
	@Select({
		"SELECT * FROM index_image"
	})
	@ResultMap("BaseResultMap")
	List<IndexImage> getAll();
	
	@Select({
		"SELECT * FROM index_image WHERE plate = '一键通快讯'"
	})
	@ResultMap("BaseResultMap")
	List<IndexImage> getKuaiXun();
}
